sqlite 截取字符串函数substr

函数:substr(string string,num start,num length)

用法:

string为字符串;

start为起始位置;字符串的第一个字符的位置为1,不是从0开始计算

length为长度。

 

例子:

假设表table1

存在以下数据

mark                                                                                           
1000
1000
0001
0002

 

select  mark from table1 where  substr(mark,1,2)='00'

结果集如下:

 

mark                                                                                           
0001
0002

 

编者注:

Substring()函数,经过测试,并不适合sqlite数据库。

 

posted @ 2013-12-08 18:57  ygm900  阅读(36226)  评论(0编辑  收藏  举报